﻿CREATE TABLE [dbo].[OrderBaseInfo] (
    [OrderID]            VARCHAR (32)     NOT NULL,
    [UserID]             BIGINT           NOT NULL,
    [OrderType]          TINYINT          NOT NULL,
    [CreationTime]       DATETIME         NOT NULL,
    [OrderReceiptInfoID] UNIQUEIDENTIFIER NULL,
    [OrderExpressID]     UNIQUEIDENTIFIER NULL,
    [ProductSnap]        NVARCHAR (MAX)   NULL,
    [PaymentSnap]        NVARCHAR (MAX)   NULL,
    [TotalFee]           MONEY            NULL,
    [NeedPayFee]         MONEY            NULL,
    [Remarks]            NVARCHAR (200)   NULL,
    [LeaveMsg]           NVARCHAR (200)   NULL,
    [OrderPaymentID]     UNIQUEIDENTIFIER NULL,
    [OrderStatus]        TINYINT          NULL,
    [BalanceOfDeduction] MONEY            NULL,
    [AutoCloseTime]      DATETIME         NULL,
    [SplitFormOrderID]   VARCHAR (32)     NULL,
    [AutoCompleteTime]   DATETIME         NULL,
    CONSTRAINT [PK_ORDERBASEINFO] PRIMARY KEY CLUSTERED ([OrderID] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'自动完成时间（自动确认收货）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'AutoCompleteTime';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'拆分前订单标识', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'SplitFormOrderID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单自动关闭时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'AutoCloseTime';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'余额抵扣金额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'BalanceOfDeduction';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单状态。10：待付款；20：待审核；30：待发货；40：待收货；50：关闭的订单；60：交易已完成；70：已被拆分', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'OrderStatus';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单支付信息标识', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'OrderPaymentID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'买家留言', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'LeaveMsg';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'备注', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'Remarks';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'需要支付金额。支付过程中已经支付的金额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'NeedPayFee';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'总金额。订单总的需要支付的金额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'TotalFee';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'支付信息快照。约定好的数据结构（如JSON、XML等）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'PaymentSnap';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'购买商品信息快照。约定好的数据结构（如JSON、XML等）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'ProductSnap';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单快递标识', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'OrderExpressID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单收获信息标识', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'OrderReceiptInfoID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'下单时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'CreationTime';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单类型', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'OrderType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'用户标识', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'UserID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单标识/订单号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo', @level2type = N'COLUMN', @level2name = N'OrderID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'订单基本信息', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderBaseInfo';

